" File: vimrc.vim
" Author: Stephen Morrow (yawmark)
" Description: Additional vimrc goodness
" Last Modified: January 14, 2011

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" General
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Copy team notes
nnoremap <leader>c 1GV/\/\/\~<cr>y:noh<cr>

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Groovy
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Easily run Groovy script
" Requires GroovyServ - http://kobo.github.com/groovyserv/
nnoremap <silent> <M-4> :w<cr>:!groovyclient %<cr>

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Java
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Easily compile and run scratch Java class
" NOTE: gawk needs to be in your system path (Cygwin in Windows can help)
autocmd BufRead *.java set makeprg=javac\ %
autocmd BufRead *.java set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#
nnoremap <silent> <F10> :w<cr>:make<cr>
nnoremap <silent> <F11> :!echo %\\|gawk -F. '{print $1}'\\|xargs java<cr>

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Clojure
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let clj_highlight_builtins = 1

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Python
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Easily run Python script
" Requires Python - http://www.python.org/download/
nnoremap <silent> <M-5> :w<cr>:!python %<cr>

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Snipmate 
" depends-on: http://www.vim.org/scripts/script.php?script_id=2540
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:snips_author = 'Stephen Morrow (yawmark)'

" Easier reloading of SnipMate snippets
nmap <M-r> :call ReloadAllSnippets()<cr>

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" FuzzyFinder 
" depends-on: http://www.vim.org/scripts/script.php?script_id=1984
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:fuf_modesDisable = []
let g:fuf_mrufile_maxItem = 400
let g:fuf_mrucmd_maxItem = 400
set to tm=500 " Give a reasonably short timeout for 's'
nnoremap <silent> sj     :FufBuffer<CR>
nnoremap <silent> sk     :FufFileWithCurrentBufferDir<CR>
nnoremap <silent> sK     :FufFileWithFullCwd<CR>
nnoremap <silent> s<C-k> :FufFile<CR>
nnoremap <silent> sl     :FufCoverageFileChange<CR>
nnoremap <silent> sL     :FufCoverageFileChange<CR>
nnoremap <silent> s<C-l> :FufCoverageFileRegister<CR>
nnoremap <silent> sd     :FufDirWithCurrentBufferDir<CR>
nnoremap <silent> sD     :FufDirWithFullCwd<CR>
nnoremap <silent> s<C-d> :FufDir<CR>
" These don't seem to work
" nnoremap <silent> sn     :FufMruFile<CR>
" nnoremap <silent> sN     :FufMruFileInCwd<CR>
" nnoremap <silent> sm     :FufMruCmd<CR>
nnoremap <silent> su     :FufBookmarkFile<CR>
nnoremap <silent> s<C-u> :FufBookmarkFileAdd<CR>
vnoremap <silent> s<C-u> :FufBookmarkFileAddAsSelectedText<CR>
nnoremap <silent> si     :FufBookmarkDir<CR>
nnoremap <silent> s<C-i> :FufBookmarkDirAdd<CR>
nnoremap <silent> st     :FufTag<CR>
nnoremap <silent> sT     :FufTag!<CR>
nnoremap <silent> s<C-]> :FufTagWithCursorWord!<CR>
nnoremap <silent> s,     :FufBufferTag<CR>
nnoremap <silent> s<     :FufBufferTag!<CR>
vnoremap <silent> s,     :FufBufferTagWithSelectedText!<CR>
vnoremap <silent> s<     :FufBufferTagWithSelectedText<CR>
nnoremap <silent> s}     :FufBufferTagWithCursorWord!<CR>
nnoremap <silent> s.     :FufBufferTagAll<CR>
nnoremap <silent> s>     :FufBufferTagAll!<CR>
vnoremap <silent> s.     :FufBufferTagAllWithSelectedText!<CR>
vnoremap <silent> s>     :FufBufferTagAllWithSelectedText<CR>
nnoremap <silent> s]     :FufBufferTagAllWithCursorWord!<CR>
nnoremap <silent> sg     :FufTaggedFile<CR>
nnoremap <silent> sG     :FufTaggedFile!<CR>
nnoremap <silent> so     :FufJumpList<CR>
nnoremap <silent> sp     :FufChangeList<CR>
nnoremap <silent> sq     :FufQuickfix<CR>
nnoremap <silent> sy     :FufLine<CR>
nnoremap <silent> sh     :FufHelp<CR>
nnoremap <silent> se     :FufEditDataFile<CR>
nnoremap <silent> sr     :FufRenewCache<CR>


""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" MRU (Most Recently Used) 
" depends-on: http://www.vim.org/scripts/script.php?script_id=521
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <F9> :MRU<cr>



""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" SLIMV
" depends-on: http://www.vim.org/scripts/script.php?script_id=2531
" requires: Python, Leiningen, and Swank-Clojure for repl-in-vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:slimv_lisp = '!start lein repl'
let g:slimv_python = 'c:/opt/Python27/python'
let g:slimv_repl_split = 3
let g:slimv_swank_clojure = '!start ' . $lein_home . '\lein.bat swank'
